package com.atguigu.gmall.product.client;

import com.atguigu.gmall.model.product.*;
import com.atguigu.gmall.product.client.impl.ProductDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = "service-product",fallback = ProductDegradeFeignClient.class)
public interface ProductFeignClient {

    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
     SkuInfo getSkuInfo(@PathVariable Long skuId);

    @GetMapping("/api/product/inner/getGategoryView/{category3Id}")
     BaseCategoryView getGategoryView(@PathVariable Long category3Id);

    @GetMapping("/api/product/inner/getSkuPrice/{skuId}")
     BigDecimal getSkuPrice(@PathVariable Long skuId);

    //根据spuId获取海报信息
    @GetMapping("/api/product/inner/findSpuPosterBySpuId/{spuId}")
     List<SpuPoster> findSpuPosterBySpuId(@PathVariable Long spuId);

    //根据skuId查询平台属性
    @GetMapping("/api/product/inner/getAttrList/{skuId}")
     List<BaseAttrInfo> getAttrList(@PathVariable Long skuId);


    @GetMapping("/api/product/inner/getSpuSaleAttrListCheckBySku/{skuId}/{spuId}")
     List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(@PathVariable Long skuId,
                                                    @PathVariable Long spuId);

    //商品的切换功能实现
    @GetMapping("/api/product/inner/getSkuValueIdsMap/{spuId}")
     Map getSkuValueIdsMap(@PathVariable Long spuId);

}
